-- card: 42427 from stack: in -- bmap block id: 0 -- flags: 0000 -- background id: 4755 -- name: -- part contents for background part 6 ----- text ----- 4.4 Example -- part contents for background part 4 ----- text ----- The following pages contain source code for a complete example demonstrating the use of TC/C++ object-oriented programming techniques. Each page contains a scrolling text field whose contents may be pasted into an individual source or header file for compilation. These text fields contain both TC and C++ versions, where different. In practice, conditional compilation* may be used to create programs which compile properly under both TC and C++ without modification. As mentioned earlier, it is useful to place the declaration for each class in a separate header file (indicated by the extension '.h' in the file name) which may be accessed from the appropriate source files (indicated by the '.c' extension) using the #include preprocessor directive**. (Chapter 7 also discusses #define and the #ifndef directive used by C++ to prevent multiple references to the same header file.) For each class, the method definitions are usually contained in a separate source file. Finally, the 'main.c' source file contains the main() function where execution of the program begins. -- part contents for background part 7 ----- text ----- 130 -- part contents for background part 29 ----- text ----- 55726 52189 -- part contents for background part 27 ----- text ----- TC/C++ portability File inclusion -- part contents for background part 20 ----- text ----- TC/C++ portability - p183 -- part contents for background part 23 ----- text ----- File inclusion - p175